home *** CD-ROM | disk | FTP | other *** search
/ Workbench Design / WB Collection.iso / workbench werkzeuge / bildschirmschoner / beyondthedark / developer / docs / btdsub.doc next >
Text File  |  1996-04-07  |  5KB  |  180 lines

  1. TABLE OF CONTENTS
  2.  
  3. blanker.btd/--background--
  4. blanker.btd/AnimBlanker
  5. blanker.btd/EndBlanker
  6. blanker.btd/InitBlanker
  7. blanker.btd/PenCountBlanker
  8. blanker.btd/QueryBlanker
  9.  
  10. blanker.btd/--background--
  11.  
  12. Blanker modules for Beyond The Dark are AmigaOS shared libraries with 5
  13. standard functions described in this document.
  14.  
  15. These libraries should follow the guide lines listed in the "AMIGA ROM
  16. Kernel Reference Manual: Libraries" with one additional    feature: the
  17. library base MUST be sharable between different tasks.
  18.  
  19. Because of this requirement you must NOT use SAS/C's library startup code.
  20. The source code of a generic library startup code for blanker modules is
  21. included. Of course you haven't got to use it, it's just an option to make
  22. your life easier.
  23.  
  24. Always remember that your code MUST be reentrant, so be careful with
  25. global variables. Don't make any assumptions about the supplied RastPort
  26. (it may or may not have a layer), the order of the pens or the size and
  27. the offset of the drawing box. Always use BTD_BgPen for the background.
  28.  
  29. Various examples for blanker modules are included. The best way to learn
  30. is to look at them. If you still have questions contact me.
  31.  
  32.     Matthias Scheler <tron@lyssa.owl.de>
  33. blanker.btd/AnimBlanker                                 blanker.btd/AnimBlanker
  34.  
  35.    NAME
  36.     AnimBlanker() -- animate a blanker
  37.  
  38.  
  39.    SYNOPSIS
  40.     AnimBlanker(data);
  41.                 A0
  42.  
  43.         void AnimBlanker(APTR);
  44.  
  45.    FUNCTION
  46.     Draws a "frame" of the blanker's graphics.
  47.  
  48.    NOTE
  49.     There are no rules what a "frame" is. "Hop.btd" e.g. will plot a
  50.     single pixel in a "frame", "ASwarm.btd" will move all wasps and
  51.     bees.
  52.  
  53.     If you want to synchronize your blanker with the raster beam call
  54.     WaitTOF() yourself.
  55.  
  56.     Don't use CPU busy loops e.g. by using graphics.library/WaitBOVP()
  57.     because other blanker modules could use the CPU time much better.
  58.  
  59.    EXAMPLE
  60.     /* plot something with the 2nd pen */
  61.     SetAPen (BTDDrawInfo->BDI_RPort,BTDDrawInfo->BDI_Pens[1]);
  62.     WritePixel (BTDDrawInfo->BDI_RPort,X,Y);
  63.  
  64.     /* set the 3rd color to white */
  65.     BTDDrawInfo->BDI_Red[BTDDrawInfo->BDI_Pens[2]]=255;
  66.     BTDDrawInfo->BDI_Green[BTDDrawInfo->BDI_Pens[2]]=255;
  67.     BTDDrawInfo->BDI_Blue[BTDDrawInfo->BDI_Pens[2]]=255;
  68.     BTDDrawInfo->BDI_Changed[BTDDrawInfo->BDI_Pens[2]]=TRUE;
  69.  
  70.    SEE ALSO
  71.     <BTD.h>, EndBlanker(), InitBlanker(), PenCountBlanker()
  72.  
  73. blanker.btd/EndBlanker                                   blanker.btd/EndBlanker
  74.  
  75.    NAME
  76.     EndBlanker() -- free a blanker's private data
  77.  
  78.    SYNOPSIS
  79.     EndBlanker(data);
  80.                 A0
  81.  
  82.         void EndBlanker(APTR);
  83.  
  84.    FUNCTION
  85.     Frees blanker's private data created with InitBlanker().
  86.  
  87.    INPUTS
  88.     data - pointer to blanker's private data
  89.  
  90.    SEE ALSO
  91.     <BTD.h>, AnimBlanker(), InitBlanker(), PenCountBlanker()
  92.  
  93. blanker.btd/InitBlanker                                 blanker.btd/InitBlanker
  94.  
  95.    NAME
  96.     InitBlanker() -- initialize a blanker's private data
  97.  
  98.    SYNOPSIS
  99.     data = InitBlanker(tagList);
  100.     D0                 A0
  101.  
  102.         APTR InitBlanker(struct TagItem *);
  103.  
  104.    FUNCTION
  105.     Initialize the data structures required for the blanker.
  106.  
  107.    NOTE
  108.     The contents of the structure is completely private. Programs which
  109.     use blanker libraries should NOT make any assumptions about it.
  110.  
  111.     The BTDDrawInfo structure will be valid until the EndBlanker()
  112.     call. Blanker modules haven't to copy it but it's a good idea to
  113.     store the pointer somewhere in the private date structure.
  114.  
  115.    INPUTS
  116.     tagList - list of tag items with various parameters, the tag
  117.               BTD_DrawInfo with a pointer to a BTDDrawInfo structure
  118.               should be among them.
  119.  
  120.    RESULTS
  121.     data - pointer to a structure which can be passed to AnimBlanker()
  122.            or EndBlanker(). If the initialization fails, zero will be
  123.            returned. 
  124.  
  125.    SEE ALSO
  126.     <BTD.h>, AnimBlanker(), EndBlanker(), PenCountBlanker()
  127.  
  128. blanker.btd/PenCountBlanker                         blanker.btd/PenCountBlanker
  129.  
  130.    NAME
  131.     PenCountBlanker() -- count required pens
  132.  
  133.    SYNOPSIS
  134.     pens = PenCountBlanker(tagList);
  135.     D0                     A0
  136.  
  137.         ULONG PenCountBlanker(struct TagItem *);
  138.  
  139.    FUNCTION
  140.     Determines how many pens a blanker requires. It gets the same
  141.     parameters which will later be passed to InitBlanker() except
  142.     the tag BTD_DrawInfo.
  143.  
  144.    NOTE
  145.     The result of this function MUST be correct. If the module
  146.     requires more pens than returned by PenCountBlanker() there
  147.     will be a problem.
  148.  
  149.    INPUTS
  150.     tagList - list of tag items with various parameters
  151.  
  152.    RESULTS
  153.     pens - number of pens required for these parameters
  154.  
  155.    SEE ALSO
  156.     <BTD.h>, AnimBlanker(), EndBlanker(), InitBlanker()
  157.  
  158. blanker.btd/QueryBlanker                               blanker.btd/QueryBlanker
  159.  
  160.    NAME
  161.     QueryBlanker -- get information about blanker sub library
  162.  
  163.    SYNOPSIS
  164.     info = QueryBlanker();
  165.     D0
  166.  
  167.     struct BTDInfo *QueryBlanker(void);
  168.  
  169.    FUNCTION
  170.     Returns a pointer to a structure with informations about the blanker
  171.     sub library. These informations are used to verify that the library
  172.     is compatible with the actual interface definition, to identify the
  173.     blanker and to build up the preferences window for it.
  174.  
  175.    RESULTS
  176.     info - pointer to the blanker informations
  177.  
  178.    SEE ALSO
  179.     <BTD.h>
  180.